#include <iostream>
#include <unordered_set>
using namespace std;
using ll=long long;
const int N=1e9+10;


unordered_set<int> has;
int main()
{
	ll p=1;
	while(p<N)
	{
		has.insert(p);
		p*=2;
	}
	int n;
	int ret=0;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		int num;
		cin>>num;
		if(!has.count(num))
		{
			ret++;
		}
	}
	cout<<ret<<endl;
	return 0;
}
